#!/usr/local/bin/perl #cgi-lib contains functions to manipulate the data contained in html forms require "cgi-lib"; #The readparse function (from cgi-lib) will create an associative array #containing the data from the html form. #Each element of the array will have the same name as the html form item &ReadParse; #Generate http header print "Content-type:text/html\n\n"; #Generate HTML code for AmigaSoc header #Normally the perl print statement is of the form #print "stuff_to_print"; #however as we have quotes ("") within our Stuff_to_print we have to #use alternative quite characters. These are defined with the qq statement #normal choices include the curly braces {} or the pipe symbol || print qq{}; print qq{


}; #The following line is a "normal" perl print statement as it contains no ""'s print "$in{Name}, thank you for you comments. We will look at them soon.
"; print qq{



}; #print the end of html tags print ""; #Email the information to webmaster@uk.amigasoc.org #You should change this address to your_login@your_machinename.your_domainname open(MAIL,"|mail webmaster\@uk.amigasoc.org"); print MAIL "Subject: Feedback Form\n"; #Loop through the array containing the form data and print each element #on a new line. foreach $i (keys(%in)) { print MAIL "$i = $in{$i}\n"; } close (MAIL);